package myUtils;

import java.math.BigDecimal;

/**
 * 阶乘
 * @author Sever
 *
 */
public  class Factorial {
	
	/**
	 * 获得结果
	 * @param number
	 * @return
	 */
	public static BigDecimal getResult(long number){
		BigDecimal  sum = new BigDecimal(1);
		for(BigDecimal i = new BigDecimal(number);i.compareTo(BigDecimal.ZERO)==1;i=i.subtract(new BigDecimal(1))){
			sum = sum.multiply(i);
		}
		return sum;
	}
}
